require("./aui-pull-refresh")
module.exports = {
	pullRefresh:null,
	refresh: function(name, callback) {
		pullRefresh = new auiPullToRefresh({
			// container: document.querySelector('.aui-refresh-content'), //下拉容器
			container: document.querySelector(name), //下拉容器
			triggerDistance: 100 //下拉高度
		}, function(ret) {
			if (ret.status == "success") {
				
				$.isFunction(callback) && callback(ret);
			}else{
				$.isFunction(callback) && callback(ret);
			}
		})
	},
	// 隐藏刷新
	cancelLoading: function(){
		setTimeout(function(){
			pullRefresh.cancelLoading(); //隐藏下拉刷新
		},500)
	},
}
